package cn.itcast.web.controller;

import cn.itcast.domain.Company;
import cn.itcast.service.CompanyService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.UUID;

@Controller
public class CompanyController {

    @Reference
    private CompanyService companyService;

    @RequestMapping(value = "/apply")
    public String apply(){

            Company company = new Company();
            company.setId(UUID.randomUUID().toString());
            company.setState(0);
            companyService.saveCompany(company);
            return "redirect:/commit.html";
    }
}
